package com.goodving.guli.activity;

import android.bluetooth.BluetoothDevice;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import com.goodving.guli.bt.profile.scale.XMLeScanCenter;
import com.goodving.guli.model.BraceletBtInfo;
import com.goodving.guli.model.BtDevice;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.logging.Handler;

/**
 * Created by john on 2015/11/30.
 */
public class SearchSingleBraceletActivity extends SystemBarTintActivity  {
    private static final int f9144C = 30000;
    private static final int f9145D = 1000;
    private static final int f9146E = 90000;
    private static final int f9147F = 60000;
    public static final String f9148a = "REF_NOT_KNOCKED";
    public static final int f9149c = 2000;
    public static final int f9150d = 0;
    public static final int f9151e = 1;
    private static final String f9152f = "SearchSingleBraceletActivity";
    private static final int f9153g = 2000;
    private static final int f9154h = 30;
    private static final boolean f9155i = false;
    private static final int f9156j = 8193;
    private static final int f9157k = 4097;
    private static final int f9158l = 4098;
    private static final int f9159m = 4099;
    private static final int f9160n = 4100;
    private static final int f9161o = 4101;
    private static final int f9162p = 4102;
    private static final int f9163q = 4103;
    private static final int f9164r = 4104;
    private static final int f9165s = 4105;
    private static final int f9166t = 4106;
    private static Handler f9167v;
    private Context f9168A;
    private BluetoothDevice f9169B;
    private BtDevice f9170G;
    private TextView f9171H;
    private TextView f9172I;
    private TextView f9173J;
    private TextView f9174K;
    private View f9175L;
    private BraceletBtInfo f9176M;
//    private GifView f9177N;
    private boolean f9178O;
//    private LinePieChartView f9179P;
    private ImageView f9180Q;
    private boolean f9181R;
    private ImageButton f9182S;
    private View f9183T;
    private boolean f9184U;
//    private Config f9185V;
    private BroadcastReceiver f9186W;
    private XMLeScanCenter f9187X;
//    private FilterBleDevInfo f9188Y;
    private long f9189Z;
    private long aa;
    private HashMap<String, String> ab;
    private long ac;
    private boolean ad;
    public boolean f9190b;
    private long f9191u;
    private ListView f9192w;
    private ArrayList<BtDevice> f9193x;
    private ArrayList<BtDevice> f9194y;
//    private C1814R f9195z;

    static {
        f9167v = null;
    }

    public SearchSingleBraceletActivity() {
        this.f9190b = f9155i;
        this.f9191u = -1;
        this.f9192w = null;
        this.f9193x = new ArrayList();
        this.f9194y = new ArrayList();
//        this.f9195z = null;
        this.f9168A = null;
        this.f9169B = null;
        this.f9184U = f9155i;
//        this.f9185V = Config.m8876h();
        this.f9186W = null;
        this.f9187X = XMLeScanCenter.getInstance();
//        this.f9188Y = null;
        this.f9189Z = 0;
        this.aa = 0;
        this.ab = new HashMap();
        this.ac = 0;
        this.ad = f9155i;
    }

//    private void m13989a(BluetoothDevice bluetoothDevice) {
//        GuliLog.tracePrintInfo(f9152f, "connect : " + bluetoothDevice.getAddress());
//        this.f9169B = bluetoothDevice;
//        UserInfo p = Utils.m8093p();
//        if (p == null) {
//            C0668a.m8144c(C0668a.es);
//        }
//        p.f19676j = Keeper.readSwitchOperator().enableClearData ? (byte) 1 : (byte) 0;
//        XMBLEManager.m25151a(bluetoothDevice, (boolean) f9155i, p);
//        f9167v.sendEmptyMessage(f9157k);
//        f9167v.removeMessages(f9161o);
//        f9167v.sendEmptyMessageDelayed(f9161o, C4125d.f20546g);
//        C0668a.m8142c(this.f9168A, C0668a.dH);
//    }
//
//    private void m13995b(boolean z) {
//        if (z) {
//            m14004h();
//            this.f9171H.setText(R.string.bind_bracelet);
//            this.f9172I.setText(R.string.found_bracelet_info);
//            this.f9173J.setVisibility(View.INVISIBLE);
//            this.f9174K.setVisibility(f9150d);
//            this.f9174K.setText(Html.fromHtml("<u>" + getString(R.string.device_not_response) + "</u>"));
//            this.f9179P.setVisibility(View.INVISIBLE);
//            this.f9180Q.setVisibility(View.INVISIBLE);
//            this.ac = System.currentTimeMillis();
//            return;
//        }
//        m14006i();
//        this.f9171H.setText(R.string.search_devices_title);
//        this.f9172I.setText(R.string.search_devices_info);
//        this.f9173J.setVisibility(f9150d);
//        this.f9174K.setVisibility(View.GONE);
//        this.f9179P.setVisibility(f9150d);
//        this.f9180Q.setVisibility(f9150d);
//        this.f9181R = f9155i;
//    }
//
//    private void m14002g() {
//        this.f9195z = new C1814R(this, this.f9193x);
//        this.f9183T = findViewById(R.id.search_single_device_list_area);
//        this.f9192w = (ListView) findViewById(R.id.device_list_lv);
//        this.f9192w.setAdapter(this.f9195z);
//        this.f9192w.setOnItemClickListener(new dq(this));
//        this.f9177N = (GifView) findViewById(R.id.bracelet_hand_gifview);
//        this.f9175L = findViewById(R.id.search_single_area);
//        this.f9171H = (TextView) findViewById(R.id.search_devices_title);
//        this.f9172I = (TextView) findViewById(R.id.search_devices_info);
//        this.f9173J = (TextView) findViewById(R.id.search_devices_exit);
//        this.f9173J.setText(Html.fromHtml("<u>" + getString(R.string.donot_bind) + "</u>"));
//        this.f9173J.setOnClickListener(this);
//        this.f9173J.setVisibility(f9150d);
//        this.f9174K = (TextView) findViewById(R.id.search_devices_not_response);
//        this.f9174K.setOnClickListener(this);
//        this.f9174K.setVisibility(View.GONE);
//        this.f9180Q = (ImageView) findViewById(R.id.search_devices_mili_icon);
//        this.f9182S = (ImageButton) findViewById(R.id.toggle_display_mode_btn);
//        this.f9182S.setOnClickListener(this);
//        this.f9179P = (LinePieChartView) findViewById(R.id.searching_pie_chart);
//        this.f9179P.setMode(2);
//        this.f9179P.d_();
//    }
//
//    private void m14004h() {
//        this.f9177N.setVisibility(f9150d);
//        this.f9177N.m25810c(R.drawable.bracelet_bind);
//        this.f9177N.setOnClickListener(this);
//        this.f9177N.m25803a(C4013f.COVER);
//        this.f9177N.m25808b((int) ChartData.f4049d);
//    }
//
//    private void m14006i() {
//        this.f9177N.setVisibility(View.GONE);
//    }
//
//    private boolean m14008j() {
//        BluetoothAdapter defaultAdapter = BluetoothAdapter.getDefaultAdapter();
//        if (defaultAdapter == null || defaultAdapter.isEnabled()) {
//            return true;
//        }
//        startActivityForResult(new Intent("android.bluetooth.adapter.action.REQUEST_ENABLE"), f9156j);
//        return f9155i;
//    }
//
//    private void m14010k() {
//        f9167v = new dr(this);
//        this.f9186W = new ds(this);
//        IntentFilter intentFilter = new IntentFilter();
//        intentFilter.addAction(BLEService.f19416b);
//        intentFilter.addAction(BLEService.f19421g);
//        registerReceiver(this.f9186W, intentFilter);
//    }
//
//    private void m14011l() {
//        C3941i q = Utils.m8095q();
//        SwitchOperator readSwitchOperator = Keeper.readSwitchOperator();
//        int i = f9150d;
//        SportDay sportDay = new SportDay();
//        long j = C0886a.m9071f(this.f9168A).uid;
//        if (readSwitchOperator.type == f9151e && readSwitchOperator.lastUid != j) {
//            Summary c = DataManager.m12179a().m12215c(sportDay);
//            if (c != null) {
//                int steps = c.getSteps();
//                readSwitchOperator.steps = steps;
//                readSwitchOperator.date = sportDay.getKey();
//                Keeper.keepSwitchOperator(readSwitchOperator);
//                GuliLog.m12370d(f9152f, "uid:" + j + ",summary steps:" + steps);
//            } else {
//                GuliLog.m12370d(f9152f, "uid:" + j + ",no summary steps!!!");
//            }
//        }
//        if (readSwitchOperator.isValidBaseSteps()) {
//            i = readSwitchOperator.steps;
//        }
//        new C3823k(q, i, new dt(this)).m9825g();
//    }
//
//    private void m14013m() {
//        m14016p();
//        if (f9167v != null) {
//            f9167v.removeMessages(f9158l);
//            f9167v.removeMessages(f9159m);
//            f9167v.removeMessages(f9161o);
//            return;
//        }
//        GuliLog.tracePrintInfo(f9152f, "mHandler is NULL!!!!!!!!!!!!!!!!!");
//    }
//
//    private void m14014n() {
//        XMBLEManager.m25155b();
//    }
//
//    @TargetApi(18)
//    private void m14015o() {
//        GuliLog.tracePrintInfo(f9152f, "startScanNew........");
//        this.f9189Z = System.currentTimeMillis();
//        this.f9193x.clear();
//        this.f9195z.notifyDataSetChanged();
//        C0668a.m8142c(this, C0668a.dE);
//        this.f9187X.startScan(this.f9168A, this.f9188Y);
//        f9167v.removeMessages(f9158l);
//        f9167v.sendEmptyMessageDelayed(f9158l, 90000);
//        f9167v.removeMessages(f9159m);
//        f9167v.sendEmptyMessageDelayed(f9159m, 30000);
//    }
//
//    @SuppressLint({"NewApi"})
//    private void m14016p() {
//        if (this.f9188Y != null) {
//            this.f9187X.m25373a(this.f9188Y);
//        }
//    }
//
//    private void m14017q() {
//        C3942j a = XMBLEManager.m25149a();
//        if (a != null) {
//            a.m25563C();
//        }
//    }
//
//    private void m14018r() {
//        C1327j.m11576a(this.f9168A, WebAPI.m11583a(getApplicationContext(), (int) f9150d), new du(this), true);
//    }
//
//    private void m14019s() {
//        m14013m();
//        m14014n();
//        Intent intent = new Intent(this.f9168A, MultiDevicesErrActivity.class);
//        intent.putExtra(Utils.f3493a, Utils.f3494b);
//        if (this.f9178O) {
//            intent.putExtra(f9148a, R.string.device_not_found_not_knocked);
//        }
//        startActivity(intent);
//        setResult(-1);
//        finish();
//    }
//
//    private void m14020t() {
//        m14013m();
//        m14014n();
//        Intent intent = new Intent(this.f9168A, DeviceNotFoundActivity.class);
//        intent.putExtra(Utils.f3493a, Utils.f3494b);
//        startActivity(intent);
//        setResult(-1);
//        finish();
//    }
//
//    protected void m14021a() {
//        GuliLog.tracePrintInfo(f9152f, "onHideApp: finish()");
//        m14014n();
//        finish();
//    }
//
//    public void m14022a(BluetoothDevice bluetoothDevice, int i) {
//        BtDevice btDevice = new BtDevice(bluetoothDevice, i);
//        f9167v.removeMessages(f9159m);
//        f9167v.sendEmptyMessageDelayed(f9159m, 30000);
//        if (this.f9190b) {
//            synchronized (this.f9194y) {
//                this.f9194y.add(btDevice);
//                f9167v.sendEmptyMessage(f9165s);
//            }
//        } else {
//            this.f9193x.add(btDevice);
//        }
//        GuliLog.m12370d(f9152f, "found mili:" + btDevice.device.getAddress() + ", " + btDevice.device.getName() + ", " + btDevice.signal + ", divice count:" + this.f9193x.size());
//        if (this.f9176M == null || !btDevice.device.getAddress().equals(this.f9176M.f19636b)) {
//            if (this.f9170G == null) {
//                this.f9170G = btDevice;
//            } else if (btDevice.signal > this.f9170G.signal) {
//                GuliLog.tracePrintInfo(f9152f, "Found a bigger signal : " + btDevice.signal);
//                this.f9170G = btDevice;
//            }
//            if (this.f9193x.size() > f9154h || this.f9170G.signal == 0) {
//                m14016p();
//                this.ab.clear();
//                this.aa = System.currentTimeMillis();
//                this.ab.put(C0715c.f3773o, this.f9193x != null ? this.f9193x.size() + C3657a.f18328f : WeiboAuthException.DEFAULT_AUTH_ERROR_CODE);
//                this.ab.put(C0715c.f3774p, this.f9170G != null ? this.f9170G.signal + C3657a.f18328f : WeiboAuthException.DEFAULT_AUTH_ERROR_CODE);
//                this.ab.put(C0715c.f3775q, this.f9170G != null ? this.f9170G.getAddress() + C3657a.f18328f : WeiboAuthException.DEFAULT_AUTH_ERROR_CODE);
//                this.ab.put(C0715c.f3761c, (this.aa - this.f9189Z) + C3657a.f18328f);
//                C0668a.m8131a(this.f9168A, C0708b.f3708W, this.ab);
//                f9167v.sendEmptyMessage(f9158l);
//                f9167v.removeMessages(f9159m);
//                GuliLog.tracePrintInfo(f9152f, "============= Reach the scan limit, start connecting ==============");
//                return;
//            }
//            return;
//        }
//        GuliLog.tracePrintInfo(f9152f, "FOUND last device:" + this.f9176M.f19636b);
//        this.f9170G = btDevice;
//        f9167v.removeMessages(f9159m);
//        f9167v.removeMessages(f9158l);
//        f9167v.sendEmptyMessage(f9158l);
//        this.ab.clear();
//        this.aa = System.currentTimeMillis();
//        this.ab.put(C0715c.f3773o, this.f9193x != null ? this.f9193x.size() + C3657a.f18328f : WeiboAuthException.DEFAULT_AUTH_ERROR_CODE);
//        this.ab.put(C0715c.f3774p, this.f9170G != null ? this.f9170G.signal + C3657a.f18328f : WeiboAuthException.DEFAULT_AUTH_ERROR_CODE);
//        this.ab.put(C0715c.f3775q, this.f9170G != null ? this.f9170G.getAddress() + C3657a.f18328f : WeiboAuthException.DEFAULT_AUTH_ERROR_CODE);
//        this.ab.put(C0715c.f3761c, (this.aa - this.f9189Z) + C3657a.f18328f);
//        C0668a.m8131a(this.f9168A, C0708b.f3708W, this.ab);
//        m14016p();
//    }
//
//    public void m14023a(FilterBleDevInfo filterBleDevInfo) {
//    }
//
//    public void m14024a(C3907e c3907e, FilterBleDevInfo filterBleDevInfo) {
//        GuliLog.m12370d(f9152f, "onScanedDevice:\n" + c3907e);
//        if (c3907e.rssi == 0 || c3907e.m25435b() || c3907e.m25433a()) {
//            f9167v.sendMessage(f9167v.obtainMessage(f9166t, c3907e));
//        } else {
//            GuliLog.m12370d(f9152f, "connected bracelet advertising!!!");
//        }
//    }
//
//    protected void m14025a(boolean z) {
//        this.f9190b = z;
//        if (this.f9190b) {
//            this.f9175L.setVisibility(View.GONE);
//            this.f9183T.setVisibility(f9150d);
//            this.f9176M = null;
//            return;
//        }
//        this.f9176M = Keeper.readBraceletBtInfo();
//        this.f9175L.setVisibility(f9150d);
//        this.f9183T.setVisibility(View.GONE);
//    }
//
//    public void m14026b() {
//        long currentTimeMillis = System.currentTimeMillis();
//        if (this.f9191u == -1) {
//            C3247b.m22928a((Context) this, (int) R.string.app_exit_press_again, (int) f9150d).show();
//            this.f9191u = currentTimeMillis;
//            f9167v.sendEmptyMessageDelayed(f9160n, 2000);
//        } else if (currentTimeMillis - this.f9191u < 2000) {
//            this.f9191u = -1;
//            m14021a();
//        }
//    }
//
//    public void m14027b(FilterBleDevInfo filterBleDevInfo) {
//    }
//
//    public void m14028c() {
//        GuliLog.tracePrintInfo(f9152f, "onAuthenticationFailed");
//        m13995b(true);
//        if (this.f9190b) {
//            C3247b.m22928a(this.f9168A, (int) R.string.please_knock_bracelet, (int) f9151e).show();
//        }
//    }
//
//    public void m14029d() {
//        GuliLog.tracePrintInfo(f9152f, "onResetAuthentiacationFailed");
//        if (this.f9190b) {
//            C3247b.m22928a(this.f9168A, (int) R.string.device_not_found_not_knocked, (int) f9150d).show();
//        }
//        this.f9178O = true;
//    }
//
//    @TargetApi(17)
//    public void m14030e() {
//        GuliLog.tracePrintInfo(f9152f, "onDeviceConnetedSuccess: Compaire OK!");
//        if (this.f9184U) {
//            GuliLog.tracePrintInfo(f9152f, "onDeviceConnetedSuccess: Compaire OK!, But the activity has been destroyed");
//            return;
//        }
//        C3910h g = XMBLEManager.m25162g();
//        if (g == null || this.f9169B == null) {
//            GuliLog.m12370d(f9152f, "onDeviceConnetedSuccess, DeviceInfo is null!");
//            return;
//        }
//        BraceletBtInfo braceletBtInfo = new BraceletBtInfo();
//        braceletBtInfo.f19637c = this.f9169B.getName();
//        braceletBtInfo.f19636b = this.f9169B.getAddress();
//        braceletBtInfo.f19638d = g.m25450k();
//        if (g.m25440a()) {
//            GuliLog.m12370d(f9152f, "Device is 1S !");
//            braceletBtInfo.f19639e = g.m25455p();
//            braceletBtInfo.f19635a = 4;
//            PersonInfo readPersonInfo = Keeper.readPersonInfo();
//            readPersonInfo.setBinded1S(true);
//            readPersonInfo.setNeedSyncServer(2);
//            Keeper.keepPersonInfo(readPersonInfo);
//        } else if (g.m25441b()) {
//            GuliLog.m12370d(f9152f, "Device is 1A !");
//            braceletBtInfo.f19635a = 5;
//        } else {
//            GuliLog.m12370d(f9152f, "Device is 1!");
//            braceletBtInfo.f19635a = f9150d;
//        }
//        DeviceSource.bindBracelet(braceletBtInfo);
//        DeviceSource.unbindSensorHub();
//        C0886a.m9064a(this.f9168A, g.f19711a);
//        m14018r();
//        LuaEvent.getInstance(this.f9168A).setDefaultMsgs();
//        this.f9179P.m8507b();
//        if (this.f9184U) {
//            GuliLog.tracePrintInfo(f9152f, "onDeviceConnetedSuccess: Compaire OK!, But the activity has been destroyed");
//            return;
//        }
//        int i;
//        if (this.f9181R) {
//            Keeper.keepIsPlayEnterAnimation(Boolean.valueOf(true));
//            Keeper.keepPlayEnterAnimationType(f9151e);
//            i = f9150d;
//        } else {
//            this.f9179P.showNormalLine();
//            this.f9171H.setText(R.string.bind_bracelet_ok);
//            this.f9172I.setText(R.string.welcom_back);
//            this.f9180Q.setImageResource(R.drawable.ok_mark);
//            this.f9182S.setVisibility(View.GONE);
//            this.f9173J.setVisibility(View.GONE);
//            Keeper.keepIsPlayEnterAnimation(Boolean.valueOf(true));
//            Keeper.keepPlayEnterAnimationType(2);
//            this.ab.clear();
//            this.ab.put(C0715c.f3761c, (System.currentTimeMillis() - this.ac) + C3657a.f18328f);
//            this.ab.put(C0715c.f3775q, this.f9170G != null ? this.f9170G.getAddress() : WeiboAuthException.DEFAULT_AUTH_ERROR_CODE);
//            C0668a.m8131a(this.f9168A, C0708b.ae, this.ab);
//            i = f9153g;
//        }
//        if (this.f9184U) {
//            GuliLog.tracePrintInfo(f9152f, "onDeviceConnetedSuccess: Compaire OK!, But the activity has been destroyed");
//            return;
//        }
//        f9167v.postDelayed(new dv(this), (long) i);
//        C0668a.m8128a(this.f9168A, C0668a.dG, C0668a.dA);
//        EventBus.getDefault().post(new EventDeviceBoundState(f9150d, f9151e));
//    }
//
//    protected void onActivityResult(int i, int i2, Intent intent) {
//        GuliLog.tracePrintInfo(f9152f, "requestCode =" + i + ", resultCode=" + i2);
//        if (i == f9156j) {
//            switch (i2) {
//                case C4216b.f20833a /*-1*/:
//                    m14015o();
//                    break;
//                case f9150d /*0*/:
//                    C3247b.m22930a((Context) this, getString(R.string.failed_enable_bt), (int) f9151e).show();
//                    finish();
//                    break;
//            }
//        }
//        super.onActivityResult(i, i2, intent);
//    }
//
//    public void onBackPressed() {
//        DeviceSource.unbindBracelet();
//        if (this.f9190b) {
//            m14017q();
//            finish();
//            return;
//        }
//        m14026b();
//    }
//
//    public void onClick(View view) {
//        boolean z = true;
//        switch (view.getId()) {
//            case R.id.toggle_display_mode_btn:
//                m14013m();
//                if (m14008j()) {
//                    m14015o();
//                }
//                if (this.f9190b) {
//                    z = f9155i;
//                }
//                m14025a(z);
//            case R.id.search_devices_exit:
//                m14013m();
//                m14014n();
//                setResult(-1);
//                finish();
//                startActivity(new Intent(this, ScaleActivity.class));
//                C0668a.m8126a((Context) this, C0668a.dI);
//                C0668a.m8129a((Context) this, C0708b.f3707V, C0715c.f3772n, Constants.VIA_TO_TYPE_QQ_GROUP);
//            case R.id.search_devices_not_response:
//                if (this.f9186W != null) {
//                    unregisterReceiver(this.f9186W);
//                    this.f9186W = null;
//                }
//                m14017q();
//                m14019s();
//                this.f9181R = true;
//                HashMap hashMap = new HashMap();
//                hashMap.put(C0715c.f3773o, this.f9193x != null ? this.f9193x.size() + C3657a.f18328f : WeiboAuthException.DEFAULT_AUTH_ERROR_CODE);
//                hashMap.put(C0715c.f3774p, this.f9170G != null ? this.f9170G.signal + C3657a.f18328f : WeiboAuthException.DEFAULT_AUTH_ERROR_CODE);
//                hashMap.put(C0715c.f3775q, this.f9170G != null ? this.f9170G.getAddress() + C3657a.f18328f : WeiboAuthException.DEFAULT_AUTH_ERROR_CODE);
//                C0668a.m8131a(this.f9168A, C0708b.f3711Z, hashMap);
//            default:
//        }
//    }
//
//    protected void onCreate(Bundle bundle) {
//        super.onCreate(bundle);
//        setContentView((int) R.layout.activity_search_single_bracelet);
//        getWindow().setWindowAnimations(R.style.NoneTransition);
//        this.f9184U = f9155i;
//        GuliLog.tracePrintInfo(f9152f, "onCreate");
//        this.f9188Y = new C3900g().setTimeout((int) f9146E).m25388a((C1798h) this).m25391a(true).setUUID(C3934a.h_).create();
//        this.f9168A = this;
//        m14010k();
//        Config c0815b = this.f9185V;
//        if (!Config.f4188x) {
//            ActionBar actionBar = getActionBar();
//            if (actionBar != null) {
//                actionBar.hide();
//            }
//        }
//        m14002g();
//        Intent intent = getIntent();
//        if (intent != null) {
//            this.f9190b = intent.getBooleanExtra(C4220a.bz, f9155i);
//            GuliLog.tracePrintInfo(f9152f, "mDevMode = " + this.f9190b);
//        } else {
//            this.f9190b = f9155i;
//        }
//        if (DeviceSource.hasBindSensorHub()) {
//            Utils.m8040b(this.f9168A, (int) f9150d);
//        }
//        m14014n();
//        m14013m();
//        boolean j = m14008j();
//        C0668a.m8129a(this.f9168A, C0708b.f3706U, C0715c.f3771m, j ? Constants.VIA_TO_TYPE_QQ_GROUP : Constants.VIA_RESULT_SUCCESS);
//        if (j) {
//            C0668a.m8126a(this.f9168A, C0708b.f3705T);
//            m14015o();
//        }
//        m14025a(this.f9190b);
//        EventBus.getDefault().removeStickyEvent(HwConnStatus.class);
//        EventBus.getDefault().removeStickyEvent(HwSyncDataStatus.class);
//    }
//
//    public boolean onCreateOptionsMenu(Menu menu) {
//        return true;
//    }
//
//    protected void onDestroy() {
//        super.onDestroy();
//        GuliLog.tracePrintInfo(f9152f, "onDestroy");
//        this.f9184U = true;
//        m14013m();
//        if (this.f9177N != null) {
//            try {
//                this.f9177N.m25811d();
//            } catch (Exception e) {
//                e.printStackTrace();
//            }
//            this.f9177N = null;
//        }
//        if (this.f9186W != null) {
//            unregisterReceiver(this.f9186W);
//            this.f9186W = null;
//        }
//    }
//
//    protected void onHomeBackPressed() {
//        m14013m();
//        super.onHomeBackPressed();
//    }
//
//    public boolean onOptionsItemSelected(MenuItem menuItem) {
//        switch (menuItem.getItemId()) {
//            case R.id.dev_mode:
//                m14016p();
//                m14025a(!this.f9190b ? true : f9155i);
//                if (!m14008j()) {
//                    return true;
//                }
//                m14015o();
//                return true;
//            default:
//                return super.onOptionsItemSelected(menuItem);
//        }
//    }
//
//    protected void onPause() {
//        super.onPause();
//        GuliLog.tracePrintInfo(f9152f, "onPause");
//        String str = C0668a.f3574q;
//        if (this.f9190b) {
//            str = C0668a.f3575r;
//        }
//        C0668a.m8141b(str);
//        C0668a.m8138b((Activity) this);
//    }
//
//    protected void onResume() {
//        super.onResume();
//        this.f9178O = f9155i;
////        this.f9177N.m25812e();
//        GuliLog.tracePrintInfo(f9152f, "onResume");
//        String str = C0668a.f3574q;
//        if (this.f9190b) {
//            str = C0668a.f3575r;
//        }
//        C0668a.m8133a(str);
//        C0668a.m8124a((Activity) this);
//    }
}
